package com.example.demo1.Demo2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class PeopleController2 {
    private PeopleService peopleService;

    //构造方法注入
    @Autowired
    public PeopleController2(PeopleService peopleService){
        this.peopleService = peopleService;
    }

    public void sayhi(){
        peopleService.sayhi();
    }
}
